package com.zrj.gulimal.config;

import com.zrj.gulimal.interceptor.CartInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author zhaorujie
 * @version 1.0
 * @Description
 * @date 2021/2/4 9:51
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CartInterceptor()) //注册拦截器
                .addPathPatterns("/**");
    }
}
